﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;

namespace System.Data.SugarClient
{
	public class SugarClientFactory : DbProviderFactory
	{

		public override bool CanCreateDataSourceEnumerator
		{
			get { return false; }
		}

		public override DbConnection CreateConnection()
		{
			return new SugarConnection();
		}

		public override DbCommand CreateCommand()
		{
			return new SugarCommand();
		}

		public override DbCommandBuilder CreateCommandBuilder()
		{
			return new SugarCommandBuilder();
		}

		public override DbConnectionStringBuilder CreateConnectionStringBuilder()
		{
			return new SugarConnectionStringBuilder();
		}

		public override DbDataAdapter CreateDataAdapter()
		{
			return new SugarDataAdapter();
		}

		public override DbDataSourceEnumerator CreateDataSourceEnumerator()
		{
			throw new NotImplementedException();
		}

		public override DbParameter CreateParameter()
		{
			return new SugarParameter();
		}

		public override System.Security.CodeAccessPermission CreatePermission(System.Security.Permissions.PermissionState state)
		{
			throw new NotImplementedException();
			// return base.CreatePermission(state);
		}

	}
}
